<%--
  User: yang
  Date: 9/14/20
  Time: 15:04
  Description: TODO 
--%>
<%@page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- 导入核心标签库 --%>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>测试excel的上传和下载</title>
    <%--  新 Bootstrap 核心 CSS 文件 --%>
    <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <script src="http://libs.baidu.com/jquery/1.7.0/jquery.min.js"></script>
    <%--  导入 jQuery   --%>
    <%--  最新的 Bootstrap 核心 JavaScript 文件   --%>
    <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <style type="text/css">
        table {
            width: 800px;
            margin: 20px auto;
            border: 1px solid blue;
            border-collapse: collapse;
        }

        table td, table th {
            border: 1px solid blue;
            padding: 10px;
            text-align: center;
        }
    </style>
</head>
<body>
<c:if test="${empty requestScope.list}">
    <jsp:forward page="/student/getList"/>
</c:if>
<h1 align="center">${message}</h1>
<table>
    <tr>
        <th>学号</th>
        <th>名字</th>
        <th>年龄</th>
        <th>分数</th>
        <th>生日</th>
    </tr>
    <c:forEach items="${requestScope.list}" var="s">
        <tr>
            <td>${s.sid}</td>
            <td>${s.sname}</td>
            <td>${s.sage}</td>
            <td>${s.score}</td>
            <td>${s.sbirthday}</td>
        </tr>
    </c:forEach>
</table>
<form action="<c:url value='/student/addList'/>" method="post" enctype="multipart/form-data">
    <input type="file" name="excelFile"/>
    <input type="submit" value="excel上传"/><br/>
</form>
<a href="<c:url value='/student/creteExcel'/>">生成excel</a>
</body>
</html>
